package com.junbao.module.mine.main.view;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;

import com.junbao.module.mine.R;
import com.junbao.module.mine.databinding.ActivityMainBinding;
import com.junbao.module.mine.main.viewmodel.MainViewModel;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
        MainViewModel model = new MainViewModel(this);
        binding.setViewModel(model);

        model.getUserInfo();

        binding.editPwd.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

            }

            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {

            }

            @Override
            public void afterTextChanged(Editable editable) {
                Log.d("liuyi", "afterTextChanged: "+model.userFiled.get().getPwd());
            }
        });
    }

   /* public void start(View view) {
        startActivity(new Intent(this , LoginActivity.class));
    }*/
}